﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RabbitBus
{
    /// <summary>
    /// 消息队列特性
    /// </summary>
    public class QueueConsumerAttribute : Attribute
    {
        /// <summary>
        /// 队列名称
        /// </summary>
        public string QueueName { get; set; }

        /// <summary>
        /// TODO：暂未处理此类型
        /// 交换机类型
        /// <see cref="RabbitMQ.Client.ExchangeType "/>
        /// </summary>
        public string ExchangeType { get; set; } = RabbitMQ.Client.ExchangeType.Fanout;


        /// <summary>
        /// 
        /// </summary>
        /// <param name="queueName"></param>
        public QueueConsumerAttribute(string queueName)
        {
            QueueName = queueName;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="queueName"></param>
        /// <param name="exchange">此参数必须为交换机枚举参数，参考以下枚举 <see cref=" RabbitMQ.Client.ExchangeType"/></param>
        public QueueConsumerAttribute(string queueName, string exchange)
        {
            QueueName = queueName;
            ExchangeType = exchange.ToString();
        }
    }

}
